package com.ckr.pojo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import javax.annotation.Resource;

/**
 * @author Shadowckr
 * @create 2021-11-28 17:17
 */
public class Game {
//    @Autowired
//    @Autowired(required = false) // false，对象可以为null；true，对象必须存在，不能为null
//    // @Autowired是根据类型byType自动装配的，加上@Qualifier则可以根据byName的方式自动装配
//    @Qualifier(value = "pc2")
    @Resource(name = "pc2")
    private PC pc;
//    @Autowired
//    @Qualifier(value = "mobile2")
    @Resource(name = "mobile")
    private Mobile mobile;
    private String str;

    public PC getPc() {
        return pc;
    }

//    public void setPc(PC pc) {
//        this.pc = pc;
//    }

    public Mobile getMobile() {
        return mobile;
    }

//    public void setMobile(Mobile mobile) {
//        this.mobile = mobile;
//    }

    public String getStr() {
        return str;
    }

//    public void setStr(String str) {
//        this.str = str;
//    }

    @Override
    public String toString() {
        return "Game{" +
                "pc=" + pc +
                ", mobile=" + mobile +
                ", str='" + str + '\'' +
                '}';
    }
}
